<?php
require_once "../class/fenajax.class.php";
include "../dyn/connexion.php";

$f = newFen(__FILE__,"Liste des ateliers",3);

$f->displayHeader();


$res = mysql_query("SELECT * FROM Atelier ORDER BY nom;");
if(mysql_num_rows($res)>0){
echo "<table id=\"data un\" class=\"tab-tab\">
		<tr class=\"ui-tabs-nav ui-accordion ui-state-default tab-title\">
			<th>Nom</th>
			<th>Thème</th>
			<th>Date de début</th>
			<th>Date de fin</th>
			<th>Modifier</th>
		</tr>
		";


while($row = mysql_fetch_array($res)) {
	echo "<tr class=\"tab-data\" >
			<td>".$row["nom"]."</td>
			<td>".$row["theme"]."</td> 
			<td>".$row["dateDebut"]."</td>
			<td>".$row["dateFin"]."</td>
			<td>
				<a href =\"#un\" id=\"modifAtelier\" onclick=\"formulaireAtelierModif(event)\"><img id=\"".$row['id']."\" src=\"../images/modifier.png\"  alt=\"Modifier\" title=\"Modifier cet atelier\"/></a>
			</td>
		</tr>";
}


echo "</table>";
}else{
	echo "<div class='center'>".BMInfo("Aucun atelier n'a été créé",false)."</div>";
}


$f->displayFooter();
?>